home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / IAC Tools / iacfilespec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-09  |  1.6 KB  |  75 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1988-1993 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4. #include "iacinternal.h"
  5.  
  6.  
  7.  
  8. Boolean IACpushfilespecparam (FSSpec *x, OSType keyword) {
  9.     
  10.     return (IACpushfilespecitem (IACglobals.event, x, keyword));
  11.     } /*IACpushfilespecparam*/
  12.  
  13.  
  14. Boolean IACreturnfilespec (FSSpec *x) {
  15.     
  16.     return (IACpushfilespecitem (IACglobals.reply, x, keyDirectObject));
  17.     } /*IACreturnfilespec*/
  18.  
  19.  
  20. Boolean IACgetfilespecparam (OSType keyword, FSSpec *val) {
  21.     
  22.     if (!IACgetfilespecitem (IACglobals.event, keyword, val)) {
  23.         
  24.         IACparamerror (IACglobals.errorcode, "\pfilespec", keyword);
  25.         
  26.         return (false);
  27.         }
  28.     
  29.     IACglobals.nextparamoptional = false; /*must be reset for each param*/
  30.     
  31.     return (true);
  32.     } /*IACgetfilespecparam*/
  33.     
  34.  
  35. Boolean IACgetfilespecitem (AEDescList *list, long n, FSSpec *val) {
  36.     
  37.     register OSErr ec;
  38.     DescType key;
  39.     DescType typeCode;
  40.     Size actualSize;
  41.     
  42.     if ((*list).descriptorType != typeAEList) {
  43.         
  44.         ec = AEGetKeyPtr (list, n, typeFSS, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
  45.             
  46.         if (ec != errAEDescNotFound)
  47.             goto done;
  48.         }
  49.  
  50.     ec = AEGetNthPtr (list, n, typeFSS, &key, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
  51.     
  52.     done:
  53.     
  54.     IACglobals.errorcode = ec;
  55.     
  56.     return (ec == noErr);
  57.     } /*IACgetfilespecitem*/
  58.  
  59.  
  60. Boolean IACpushfilespecitem (AEDescList *list, FSSpec *x, long n) {
  61.     
  62.     register OSErr ec;
  63.     
  64.     if ((*list).descriptorType != typeAEList)
  65.         ec = AEPutKeyPtr (list, n, typeFSS, (Ptr) x, sizeof (*x));
  66.     else
  67.         ec = AEPutPtr (list, n, typeFSS, (Ptr) x, sizeof (*x));
  68.     
  69.     IACglobals.errorcode = ec;
  70.     
  71.     return (ec == noErr);
  72.     } /*IACpushfilespecitem*/
  73.  
  74.  
  75.